package com.songshu.sb.vo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Slf4j
@Configuration
public class SystemVersion {

    @Value("${system.version}")
    private String version;
    @Value("${system.description}")
    private String systemDescription;


    public SystemVersion() {
    }

    public SystemVersion(String version, String systemDescription) {
        this.version = version;
        this.systemDescription = systemDescription;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getSystemDescription() {
        return systemDescription;
    }

    public void setSystemDescription(String systemDescription) {
        this.systemDescription = systemDescription;
    }

    @Override
    public String toString() {
        return "SystemVersion{" +
                "version='" + version + '\'' +
                ", systemDescription='" + systemDescription + '\'' +
                '}';
    }

    @PostConstruct
    public void printVersion(){
        log.info(this.toString());
    }
}
